#include "widget.h"
#include "ui_widget.h"
#include<QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(ui->pushButton,&QPushButton::clicked,this,&Widget::Handle);

}

Widget::~Widget()
{
    delete ui;
}

void Widget::Handle()
{
    if(ui->pushButton->text() == QString("按钮"))
    {
        ui->pushButton->setText("按下按钮");

    }
    else {
        ui->pushButton->setText("按钮");
    }
}



